<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" type="text/css" href="assets/bootstrap/css/bootstrap.min.css">
	
	<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
	<script type="text/javascript" src="js/common.js"></script>
	<script type="text/javascript" src="assets/bootstrap/js/bootstrap.min.js"></script>
    

	<script type="text/javascript">
		$(function() {
			//全部选择
			$("#checkAll").click(function() {  
	            $("input[name='ids']").each(function() { //遍历所有的name为ids的 checkbox  
                       $(this).prop("checked", true);  
                })  
		    })  
		    //反选
		    $("#checkToggle").click(function() {  
	            $("input[name='ids']").each(function() { //遍历所有的name为ids的 checkbox  
                       $(this).prop("checked", !this.checked);  
                })  
		    }) 
		    //取消选择
		    $("#checkDel").click(function() {  
	            $("input[name='ids']").each(function() { //遍历所有的name为ids的 checkbox  
                       $(this).prop("checked", false);  
                })  
		    }) 
		});
		
		function homePage() {
			
		}
		
		
		function query() {
			
			$("#queryForm").submit();
		}
		
	</script>
  </head>
  
  <body>
	<form class="form-inline" id="queryForm" name="queryForm" action="<%=path %>/helloWorld.html" method="post">
	<div class="container">
		<br/>
		<ol class="breadcrumb">
		  <!-- <li><a href="#">Home</a></li>
		  <li><a href="#">Library</a></li> -->
		  <li class="active"><strong>Data</strong></li>
		</ol>
		
		  <div class="form-group">
		    <label for="name">&nbsp;&nbsp;NAME</label>
		    <input type="text" class="form-control" id="name" name="name" placeholder="Jane Doe" value="${tUser.name}">
		  </div>
		  <div class="form-group">
		    <label for="password">PASSWORD</label>
		    <input type="text" class="form-control" id="password" name="password" placeholder="jane.doe" value="${tUser.password}">
		  </div>
		  <input type="hidden" name="hidden1" value="hidden1"/>
		  <button type="button" onclick="query()" class="btn btn-default">提交</button>
		
		<hr>
		<div class="btn-group" role="group" aria-label="...">
		  <button type="button" class="btn btn-primary">添加</button>
		  <button type="button" class="btn btn-success">删除</button>
		  <button type="button" class="btn btn-info">修改</button>
		  <button type="button" class="btn btn-warning" id="checkAll">全选</button>
		  <button type="button" class="btn btn-danger" id="checkToggle">反选</button>
		  <button type="button" class="btn btn-primary" id="checkDel">取消</button>
		</div>
		<table class="table table-striped table-hover">
		 	<thread>
		 		<th>#</th>
		 		<th>ID</th>
		 		<th>NAME</th>
		 		<th>ID</th>
		 		<th>NAME</th>
		 	</thread>
			<c:forEach items="${pageInfo.list}" var="user">
				<tr>
					<td><input type="checkbox" id="ids" name="ids" value='<c:out value="${user.id}"/>'/></td>
					<td><c:out value="${user.id}"/></td>
					<td><c:out value="${user.name}"/></td>
					<td><c:out value="${user.id}"/></td>
					<td><c:out value="${user.password}"/></td>
				</tr>
			</c:forEach>
		 	<%--<c:forEach items="${list}" var="user">
		 		<tr>
		 			<td><input type="checkbox" id="ids" name="ids" value='<c:out value="${user.id}"/>'/></td>
		 			<td><c:out value="${user.id}"/></td>
		 			<td><c:out value="${user.name}"/></td>
		 			<td><c:out value="${user.id}"/></td>
		 			<td><c:out value="${user.password}"/></td>
		 		</tr>
		 	</c:forEach>--%>
		</table>
		<%@include file="common/page.jsp"%>
		
		<%--<nav class="">
		  <ul class="pagination">
		    <li>
				<c:choose>
					<c:when test="${pageInfo.firstPage == null}">
						<a href="javascript:void(0);"  aria-label="首页">
							<span aria-hidden="true">首页</span>
						</a>
					</c:when>
					<c:when test="${pageInfo.firstPage != null}">
						<a href="helloWorld.html?page=${pageInfo.firstPage}&rows=${pageInfo.pageSize}&countryname=${tUser.name}&countrycode=${tUser.password}"  aria-label="首页">
							<span aria-hidden="true">首页</span>
						</a>
					</c:when>
				</c:choose>
		    </li>
			<c:choose>
				<c:when test="${pageInfo.hasPreviousPage}">
					<li><a href="helloWorld.html?page=${pageInfo.prePage}&rows=${pageInfo.pageSize}&countryname=${tUser.name}&countrycode=${tUser.password}">前一页</a></li>
				</c:when>
				<c:when test="${pageInfo.hasPreviousPage == null || pageInfo.hasPreviousPage == false}">
					<li><a href="javascript:void(0);">前一页</a></li>
				</c:when>
			</c:choose>
			<c:choose>
				<c:when test="${pageInfo.hasNextPage}">
					<li><a href="helloWorld.html?page=${pageInfo.nextPage}&rows=${pageInfo.pageSize}&countryname=${tUser.name}&countrycode=${tUser.password}">下一页</a></li>
				</c:when>
				<c:when  test="${pageInfo.hasNextPage == null || pageInfo.hasNextPage == false}">
					<li><a href="javascript:void(0);">下一页</a></li>v
				</c:when>
			</c:choose>
		    <li>
				<c:choose>
					<c:when test="${pageInfo.lastPage == null}">
					<a href="javascript:void(0);"  aria-label="末页">
							<span aria-hidden="true">末页</span>
						</a>v
					</c:when>
					<c:when test="${pageInfo.lastPage != null}">
						<a href="helloWorld.html?page=${pageInfo.lastPage}&rows=${pageInfo.pageSize}&countryname=${tUser.name}&countrycode=${tUser.password}"  aria-label="末页">
							<span aria-hidden="true">末页</span>
						</a>v
					</c:when>
				</c:choose>
		    </li>
		    <li class="diasbled">
		    	<a href="javascript:void(0);">
					共
					<strong>
						<c:choose>
							<c:when test="${pageInfo.pages != null}">
								${pageInfo.pages}
							</c:when>
							<c:when test="${pageInfo.pages == null}">
								0
							</c:when>
						</c:choose>
					</strong>页,
					第
					<strong>
						<c:choose>
							<c:when test="${pageInfo.pageNum != null}">
								${pageInfo.pageNum}
							</c:when>
							<c:when test="${pageInfo.pageNum == null}">
								0
							</c:when>
						</c:choose>
					</strong>页,
					共
					<strong>
						<c:choose>
							<c:when test="${pageInfo.total != null}">
								${pageInfo.total}
							</c:when>
							<c:when test="${pageInfo.total == null}">
								0
							</c:when>
						</c:choose>
					</strong>条记录
				</a>
		    </li>
		  </ul>
		  
		</nav>--%>
		
		<input type="hidden" name="hidden" value="hidden"/>
	</div>
	</form>


  </body>
</html>
